home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Tutorial / Cookbook / 37.Miter / MitreView.m < prev    next >
Text File  |  1995-06-12  |  1KB  |  59 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import "MitreView.h"
  5. #include <dpsclient/wraps.h>
  6. // #include <appkit/Control.h>
  7. #include <appkit/Matrix.h>
  8.  
  9.  
  10. @implementation MitreView
  11.  
  12. - lineJoinType:sender
  13. {
  14.     lineJoin = [sender selectedRow];
  15.     [self display];
  16.     return self;
  17. }
  18.  
  19. - lineCapType:sender
  20. {
  21.     lineCap = [sender selectedRow];
  22.     [self display];
  23.     return self;
  24. }
  25.  
  26. - drawSelf:(NXRect*)r :(int)c
  27. {
  28.     NXEraseRect(&bounds);
  29.     PSsetgray(NX_BLACK);
  30.     PSsetlinewidth(50.0);
  31.     PSsetlinejoin(lineJoin);
  32.     PSsetlinecap(lineCap);
  33.     PSnewpath();
  34.       PSmoveto(400.0, 50.0);
  35.       PSlineto(100.0, 50.0);
  36.       PSlineto(400.0, 250.0);
  37.     PSstroke();
  38.  
  39.     // draw the thin white line on top
  40.     PSsetgray(NX_WHITE);
  41.     PSsetlinewidth(1.0);
  42.     PSnewpath();
  43.         PSmoveto(400.0, 50.0);
  44.         PSlineto(100.0, 50.0);
  45.         PSlineto(400.0, 250.0);
  46.     PSstroke();
  47.     PSnewpath();
  48.         PSarc(400.0, 50.0, 4.0, 0.0, 360.0);
  49.         PSmoveto(100.0, 50.0);
  50.         PSarc(100.0, 50.0, 4.0, 0.0, 360.0);
  51.         PSmoveto(400.0, 250.0);
  52.         PSarc(400.0, 250.0, 4.0, 0.0, 360.0);
  53.     PSfill();
  54.     return self;
  55. }
  56.  
  57.  
  58. @end
  59.